<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>全局对象 | Math Complex</title>
    <meta name="description" content="简单易用的JavaScript复数扩展数学库">

    
    <link rel="preload" href="/math-complex/assets/css/0.styles.dc9a62cc.css" as="style"><link rel="preload" href="/math-complex/assets/js/app.a7e80bc5.js" as="script"><link rel="preload" href="/math-complex/assets/js/2.b96ecc85.js" as="script"><link rel="preload" href="/math-complex/assets/js/5.8bdadb5e.js" as="script"><link rel="prefetch" href="/math-complex/assets/js/10.e877db03.js"><link rel="prefetch" href="/math-complex/assets/js/11.aa6e74d4.js"><link rel="prefetch" href="/math-complex/assets/js/12.ef27bf30.js"><link rel="prefetch" href="/math-complex/assets/js/13.6d5e4273.js"><link rel="prefetch" href="/math-complex/assets/js/3.3a2d5ce2.js"><link rel="prefetch" href="/math-complex/assets/js/4.5f9aa696.js"><link rel="prefetch" href="/math-complex/assets/js/6.0954e40b.js"><link rel="prefetch" href="/math-complex/assets/js/7.30d57aa9.js"><link rel="prefetch" href="/math-complex/assets/js/8.6149196e.js"><link rel="prefetch" href="/math-complex/assets/js/9.6ecdb287.js">
    <link rel="stylesheet" href="/math-complex/assets/css/0.styles.dc9a62cc.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/math-complex/" class="home-link router-link-active"><!----> <span class="site-name">Math Complex</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/math-complex/" class="nav-link">
  主页
</a></div><div class="nav-item"><a href="/math-complex/guide/" class="nav-link">
  入门指南
</a></div><div class="nav-item"><a href="/math-complex/API/" class="nav-link router-link-exact-active router-link-active">
  API
</a></div><div class="nav-item"><a href="/math-complex/appendix/" class="nav-link">
  附录
</a></div><div class="nav-item"><a href="https://github.com/shawroger/math-complex" target="_blank" rel="noopener noreferrer" class="nav-link external">
  Github
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/math-complex/" class="nav-link">
  主页
</a></div><div class="nav-item"><a href="/math-complex/guide/" class="nav-link">
  入门指南
</a></div><div class="nav-item"><a href="/math-complex/API/" class="nav-link router-link-exact-active router-link-active">
  API
</a></div><div class="nav-item"><a href="/math-complex/appendix/" class="nav-link">
  附录
</a></div><div class="nav-item"><a href="https://github.com/shawroger/math-complex" target="_blank" rel="noopener noreferrer" class="nav-link external">
  Github
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div> <!----></nav>  <ul class="sidebar-links"><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading open"><span>API</span> <span class="arrow down"></span></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/math-complex/API/" class="active sidebar-link">全局对象</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/math-complex/API/#默认导出-complex" class="sidebar-link">默认导出 Complex</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/math-complex/API/#complex-abs" class="sidebar-link">Complex.abs</a></li><li class="sidebar-sub-header"><a href="/math-complex/API/#complex-abssquare" class="sidebar-link">Complex.absSquare</a></li><li class="sidebar-sub-header"><a href="/math-complex/API/#complex-contrary" class="sidebar-link">Complex.contrary</a></li><li class="sidebar-sub-header"><a href="/math-complex/API/#complex-define" class="sidebar-link">Complex.define</a></li><li class="sidebar-sub-header"><a href="/math-complex/API/#complex-fromangle" class="sidebar-link">Complex.fromAngle</a></li><li class="sidebar-sub-header"><a href="/math-complex/API/#complex-imagine" class="sidebar-link">Complex.imagine</a></li><li class="sidebar-sub-header"><a href="/math-complex/API/#complex-iscomplex" class="sidebar-link">Complex.isComplex</a></li><li class="sidebar-sub-header"><a href="/math-complex/API/#complex-mult" class="sidebar-link">Complex.mult</a></li><li class="sidebar-sub-header"><a href="/math-complex/API/#complex-number" class="sidebar-link">Complex.Number</a></li><li class="sidebar-sub-header"><a href="/math-complex/API/#complex-pow" class="sidebar-link">Complex.pow</a></li><li class="sidebar-sub-header"><a href="/math-complex/API/#complex-random" class="sidebar-link">Complex.random</a></li><li class="sidebar-sub-header"><a href="/math-complex/API/#complex-realize" class="sidebar-link">Complex.realize</a></li><li class="sidebar-sub-header"><a href="/math-complex/API/#complex-reflect" class="sidebar-link">Complex.Reflect</a></li><li class="sidebar-sub-header"><a href="/math-complex/API/#complex-tocomplex" class="sidebar-link">Complex.toComplex</a></li></ul></li><li class="sidebar-sub-header"><a href="/math-complex/API/#abs" class="sidebar-link">abs</a></li><li class="sidebar-sub-header"><a href="/math-complex/API/#abssquare" class="sidebar-link">absSquare</a></li><li class="sidebar-sub-header"><a href="/math-complex/API/#add" class="sidebar-link">add</a></li><li class="sidebar-sub-header"><a href="/math-complex/API/#complexnumber" class="sidebar-link">ComplexNumber</a></li><li class="sidebar-sub-header"><a href="/math-complex/API/#complexreflect" class="sidebar-link">ComplexReflect</a></li><li class="sidebar-sub-header"><a href="/math-complex/API/#contrary" class="sidebar-link">contrary</a></li><li class="sidebar-sub-header"><a href="/math-complex/API/#define" class="sidebar-link">define</a></li><li class="sidebar-sub-header"><a href="/math-complex/API/#fromangle" class="sidebar-link">fromAngle</a></li><li class="sidebar-sub-header"><a href="/math-complex/API/#imagine" class="sidebar-link">imagine</a></li><li class="sidebar-sub-header"><a href="/math-complex/API/#iscomplex" class="sidebar-link">isComplex</a></li><li class="sidebar-sub-header"><a href="/math-complex/API/#mult" class="sidebar-link">mult</a></li><li class="sidebar-sub-header"><a href="/math-complex/API/#pow" class="sidebar-link">pow</a></li><li class="sidebar-sub-header"><a href="/math-complex/API/#random" class="sidebar-link">random</a></li><li class="sidebar-sub-header"><a href="/math-complex/API/#realize" class="sidebar-link">realize</a></li><li class="sidebar-sub-header"><a href="/math-complex/API/#tocomplex" class="sidebar-link">toComplex</a></li><li class="sidebar-sub-header"><a href="/math-complex/API/#tryrealize" class="sidebar-link">tryRealize</a></li></ul></li><li><a href="/math-complex/API/complex-number.html" class="sidebar-link">ComplexNumber 类</a></li><li><a href="/math-complex/API/complex-reflect.html" class="sidebar-link">ComplexReflect 静态类</a></li></ul></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="全局对象"><a href="#全局对象" class="header-anchor">#</a> 全局对象</h1> <h2 id="默认导出-complex"><a href="#默认导出-complex" class="header-anchor">#</a> 默认导出 Complex</h2> <p>Complex 是 <code>math-complex</code> 的默认导出模块，你可以这样使用它</p> <div class="language-javascript extra-class"><pre class="language-javascript"><code><span class="token keyword">import</span> Complex <span class="token keyword">from</span> <span class="token string">&quot;math-complex&quot;</span><span class="token punctuation">;</span>

<span class="token keyword">const</span> <span class="token punctuation">{</span> 
    realize<span class="token punctuation">,</span> 
    imagine<span class="token punctuation">,</span> 
    add<span class="token punctuation">,</span> 
    mult<span class="token punctuation">,</span> 
    abs<span class="token punctuation">,</span> 
    contrary 
<span class="token punctuation">}</span> <span class="token operator">=</span> Complex<span class="token punctuation">.</span>Reflect<span class="token punctuation">;</span>
</code></pre></div><p>Complex本身就已经包含了<code>math-complex</code>的所有导出对象，不过一些是采用了别名。</p> <p>以下将列出在 <strong>Complex</strong> 中的所有对象</p> <h3 id="complex-abs"><a href="#complex-abs" class="header-anchor">#</a> Complex.abs</h3> <p>参见 <a href="/math-complex/API/complex-reflect.html#abs">abs</a>。</p> <h3 id="complex-abssquare"><a href="#complex-abssquare" class="header-anchor">#</a> Complex.absSquare</h3> <p>参见 <a href="/math-complex/API/#ComplexReflect.absSquare">absSquare</a>。</p> <h3 id="complex-contrary"><a href="#complex-contrary" class="header-anchor">#</a> Complex.contrary</h3> <p>参见 <a href="/math-complex/API/complex-reflect.html#contrary">contrary</a>。</p> <h3 id="complex-define"><a href="#complex-define" class="header-anchor">#</a> Complex.define</h3> <p>参见 <a href="/math-complex/API/complex-number.html#define">define</a>。</p> <h3 id="complex-fromangle"><a href="#complex-fromangle" class="header-anchor">#</a> Complex.fromAngle</h3> <p>参见 <a href="/math-complex/API/complex-number.html#fromAngle">fromAngle</a>。</p> <h3 id="complex-imagine"><a href="#complex-imagine" class="header-anchor">#</a> Complex.imagine</h3> <p>参见 <a href="/math-complex/API/complex-reflect.html#imagine">imagine</a>。</p> <h3 id="complex-iscomplex"><a href="#complex-iscomplex" class="header-anchor">#</a> Complex.isComplex</h3> <p>参见 <a href="/math-complex/API/complex-reflect.html#isComplex">isComplex</a>。</p> <h3 id="complex-mult"><a href="#complex-mult" class="header-anchor">#</a> Complex.mult</h3> <p>参见 <a href="/math-complex/API/complex-reflect.html#mult">mult</a>。</p> <h3 id="complex-number"><a href="#complex-number" class="header-anchor">#</a> Complex.Number</h3> <p><strong>ComplexNumber</strong> 类的别名引用，参见 <a href="/math-complex/API/complex-number.html">ComplexNumber</a>。</p> <h3 id="complex-pow"><a href="#complex-pow" class="header-anchor">#</a> Complex.pow</h3> <p>参见 <a href="/math-complex/API/complex-reflect.html#pow">pow</a>。</p> <h3 id="complex-random"><a href="#complex-random" class="header-anchor">#</a> Complex.random</h3> <p>参见 <a href="/math-complex/API/complex-reflect.html#random">random</a>。</p> <h3 id="complex-realize"><a href="#complex-realize" class="header-anchor">#</a> Complex.realize</h3> <p>参见 <a href="/math-complex/API/complex-reflect.html#realize">realize</a>。</p> <h3 id="complex-reflect"><a href="#complex-reflect" class="header-anchor">#</a> Complex.Reflect</h3> <p><strong>ComplexReflect</strong> 类的别名引用，参见 <a href="/math-complex/API/complex-reflect.html">ComplexReflect</a>。</p> <h3 id="complex-tocomplex"><a href="#complex-tocomplex" class="header-anchor">#</a> Complex.toComplex</h3> <p>参见 <a href="/math-complex/API/complex-reflect.html#toComplex">toComplex</a>。</p> <h2 id="abs"><a href="#abs" class="header-anchor">#</a> abs</h2> <p>即定义在 <strong>ComplexReflect</strong> 类中的静态方法的别名，参见 <a href="/math-complex/API/complex-reflect.html#abs">abs</a>。</p> <h2 id="abssquare"><a href="#abssquare" class="header-anchor">#</a> absSquare</h2> <p>即定义在 <strong>ComplexReflect</strong> 类中的静态方法的别名，参见 <a href="/math-complex/API/complex-reflect.html#abs">abs</a>。</p> <h2 id="add"><a href="#add" class="header-anchor">#</a> add</h2> <p>即定义在 <strong>ComplexReflect</strong> 类中的静态方法的别名，参见 <a href="/math-complex/API/complex-reflect.html#add">ComplexReflect.add</a>。</p> <h2 id="complexnumber"><a href="#complexnumber" class="header-anchor">#</a> ComplexNumber</h2> <p>即 <strong>ComplexNumber</strong> 类，参见 <a href="/math-complex/API/complex-number.html">ComplexReflect.add</a></p> <h2 id="complexreflect"><a href="#complexreflect" class="header-anchor">#</a> ComplexReflect</h2> <p>即 <strong>ComplexReflect</strong> 类，参见 <a href="/math-complex/API/complex-reflect.html">ComplexReflect.add</a></p> <h2 id="contrary"><a href="#contrary" class="header-anchor">#</a> contrary</h2> <p>即定义在 <strong>ComplexReflect</strong> 类中的静态方法，参见<a href="/math-complex/API/complex-reflect.html#contrary">contrary</a>。</p> <h2 id="define"><a href="#define" class="header-anchor">#</a> define</h2> <p>参见 <a href="/math-complex/API/complex-number.html#define">define</a>。</p> <h2 id="fromangle"><a href="#fromangle" class="header-anchor">#</a> fromAngle</h2> <p>即定义在 <strong>ComplexReflect</strong> 类中的静态方法的别名，参见 <a href="/math-complex/API/complex-number.html#fromAngle">fromAngle</a></p> <h2 id="imagine"><a href="#imagine" class="header-anchor">#</a> imagine</h2> <p>即定义在 <strong>ComplexReflect</strong> 类中的静态方法的别名，参见 <a href="/math-complex/API/complex-reflect.html#imagine">imagine</a>。</p> <h2 id="iscomplex"><a href="#iscomplex" class="header-anchor">#</a> isComplex</h2> <p>即定义在 <strong>ComplexReflect</strong> 类中的静态方法，参见 <a href="/math-complex/API/complex-reflect.html#isComplex">isComplex</a>。</p> <h2 id="mult"><a href="#mult" class="header-anchor">#</a> mult</h2> <p>即定义在 <strong>ComplexReflect</strong> 类中的静态方法的别名，参见 <a href="/math-complex/API/complex-reflect.html#mult">mult</a>。</p> <h2 id="pow"><a href="#pow" class="header-anchor">#</a> pow</h2> <p>即定义在 <strong>ComplexReflect</strong> 类中的静态方法的别名，参见 <a href="/math-complex/API/complex-reflect.html#pow">pow</a>。</p> <h2 id="random"><a href="#random" class="header-anchor">#</a> random</h2> <p>即定义在 <strong>ComplexReflect</strong> 类中的静态方法的别名，参见 <a href="/math-complex/API/complex-reflect.html#random">random</a>。</p> <h2 id="realize"><a href="#realize" class="header-anchor">#</a> realize</h2> <p>即定义在 <strong>ComplexReflect</strong> 类中的静态方法的别名，参见 <a href="/math-complex/API/complex-reflect.html#realize">realize</a>。</p> <h2 id="tocomplex"><a href="#tocomplex" class="header-anchor">#</a> toComplex</h2> <p>即定义在 <strong>ComplexReflect</strong> 类中的静态方法的别名，参见 <a href="/math-complex/API/complex-reflect.html#toComplex">toComplex</a>。</p> <h2 id="tryrealize"><a href="#tryrealize" class="header-anchor">#</a> tryRealize</h2> <p>即定义在 <strong>ComplexReflect</strong> 类中的静态方法的别名，参见 <a href="/math-complex/API/complex-reflect.html#tryRealize">tryRealize</a>。</p></div> <footer class="page-edit"><!----> <!----></footer> <div class="page-nav"><p class="inner"><!----> <span class="next"><a href="/math-complex/API/complex-number.html">
        ComplexNumber 类
      </a>
      →
    </span></p></div> </main></div><div class="global-ui"></div></div>
    <script src="/math-complex/assets/js/app.a7e80bc5.js" defer></script><script src="/math-complex/assets/js/2.b96ecc85.js" defer></script><script src="/math-complex/assets/js/5.8bdadb5e.js" defer></script>
  </body>
</html>
